home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / BoopsiSpeedbarTags.st < prev    next >
Text File  |  2002-05-07  |  5KB  |  123 lines

  1. " --------------------------------------------------------------------- "
  2. " BoopsiSpeedbarTags Class is a Singleton class that allows the user    "
  3. " to reference BOOPSI Speedbar class tags' hexadecimal values.          "
  4. ""
  5. "  EXAMPLE:  'myTag <- speedbarTags getTag: #SPEEDBAR_Buttons'          "
  6. ""
  7. " ALL singleton classes MUST contain the following:                     "
  8. "" 
  9. "  the methods:  isSingleton AND privateSetup     AND                   "
  10. "                 uniqueInstance Class instance variable.               "
  11. " --------------------------------------------------------------------- "
  12.  
  13. Class BoopsiSpeedbarTags :Dictionary ! uniqueInstance !
  14. [
  15.    isSingleton
  16.      ^ true  
  17. |  
  18.    privateNew ! newinstance !
  19.      newinstance <- super new.
  20.  
  21.      ^ newinstance
  22. |
  23.    new
  24.      ^ self privateSetup
  25. |
  26.    getTag: tagKey
  27.      ^ self at: tagKey
  28. |
  29.    privateInitializeDictionary
  30.  
  31.      " Defines for the speedbar node attributes: "
  32.  
  33.      self at: #SBNA_Left       put: 16r80010001. " (WORD) left offset of button. "
  34.      self at: #SBNA_Top        put: 16r80010002. " (WORD) top offset of button. "
  35.      self at: #SBNA_Width      put: 16r80010003. " (WORD) width of button. "
  36.      self at: #SBNA_Height     put: 16r80010004. " (WORD) height of button. "
  37.      self at: #SBNA_UserData   put: 16r80010005. " (APTR) user data, have a blast. "
  38.      self at: #SBNA_Enabled    put: 16r80010006. " (BOOL) Is this button enabled?. "
  39.      self at: #SBNA_Spacing    put: 16r80010007. " (WORD) spacing from last button. "
  40.      self at: #SBNA_Highlight  put: 16r80010008. " (WORD) highlight mode (see below). "
  41.  
  42.      " (struct Image *) render image pointer. "
  43.      self at: #SBNA_Image      put: 16r80010009.
  44.  
  45.      " (struct Image *) select image pointer. "
  46.      self at: #SBNA_SelImage   put: 16r8001000A.
  47.  
  48.      " (UBYTE *) optional help text message pointer. "
  49.      self at: #SBNA_Help       put: 16r8001000B.
  50.  
  51.      " (BOOL) Make button a toggle button "
  52.      self at: #SBNA_Toggle     put: 16r8001000C.
  53.  
  54.      " (BOOL) Sets state of a toggle button "
  55.      self at: #SBNA_Selected   put: 16r8001000D.
  56.  
  57.      " (BOOL) Mutual Exclusion Group Button, implies SBNA_Toggle "
  58.      self at: #SBNA_MXGroup    put: 16r8001000E.
  59.  
  60.      " (BOOL) Disable this button, ghost pattern to be rendered "
  61.      self at: #SBNA_Disabled   put: 16r8001000F.
  62.  
  63.      " Possible highlight modes. " 
  64.      self at: #SBH_NONE              put: 0.
  65.      self at: #SBH_BACKFILL          put: 1.
  66.      self at: #SBH_RECESS            put: 2.
  67.      self at: #SBH_IMAGE             put: 3.
  68.  
  69.      self at: #SPEEDBAR_Buttons      put: 16r85013001. " (struct List *) button list "
  70.  
  71.      " (WORD) Horizontal/vertical mode "
  72.      self at: #SPEEDBAR_Orientation  put: 16r85013002.
  73.  
  74.      " (UWORD) SpeedBar Background color "
  75.      self at: #SPEEDBAR_Background   put: 16r85013003.
  76.  
  77.      " (struct Window *) Window for WindowBar help "
  78.      self at: #SPEEDBAR_Window       put: 16r85013004.
  79.  
  80.      " (BOOL) Allow struming of button bar "
  81.      self at: #SPEEDBAR_StrumBar     put: 16r85013005.
  82.  
  83.      self at: #SPEEDBAR_OnButton     put: 16r85013006. " (WORD) Turn on a button by id# "
  84.      self at: #SPEEDBAR_OffButton    put: 16r85013007. " (WORD) Turn off a button by id# "
  85.      self at: #SPEEDBAR_ScrollLeft   put: 16r85013008. " (WORD) Scroll buttons left "
  86.      self at: #SPEEDBAR_ScrollRight  put: 16r85013009. " (WORD) Scroll buttons right "
  87.      self at: #SPEEDBAR_Top          put: 16r8501300A. " (WORD) First visible "
  88.      self at: #SPEEDBAR_Visible      put: 16r8501300B. " (WORD) Number visible "
  89.      self at: #SPEEDBAR_Total        put: 16r8501300C. " (WORD) Total in list "
  90.  
  91.      " (STRPTR) Window/Screen Help Text "
  92.      self at: #SPEEDBAR_Help         put: 16r8501300D.
  93.  
  94.      " (WORD) Bevel box style (BVS_BUTTON,BVS_THIN,BVS_NONE) "
  95.      self at: #SPEEDBAR_BevelStyle   put: 16r8501300E.
  96.  
  97.      " (STRPTR) last selected speedbar node number "
  98.      self at: #SPEEDBAR_Selected     put: 16r8501300F.
  99.  
  100.      " (STRPTR) last selected speedbar node pointer "
  101.      self at: #SPEEDBAR_SelectedNode put: 16r85013010.
  102.  
  103.      " (BOOL) size all buttons in bar evenly, using the largest image "
  104.      self at: #SPEEDBAR_EvenSize     put: 16r85013011.
  105.  
  106.      " SPEEDBAR_Orientation Modes "
  107.      self at: #SBORIENT_HORIZ        put: 0.
  108.      self at: #SBORIENT_VERT         put: 1.
  109.  
  110.      " OBSOLETE DO NOT USE. "
  111.      self at: #SPEEDBAR_HORIZONTAL   put: 0.
  112.      self at: #SPEEDBAR_VERTICAL     put: 1.
  113. |
  114.    privateSetup
  115.      (uniqueInstance isNil)
  116.        ifTrue: [uniqueInstance <- self privateNew.
  117.                 
  118.                 self privateInitializeDictionary.
  119.                ].
  120.                
  121.      ^ self    "or ^ uniqueInstance??"
  122. ]
  123.